package com.peanut.baby.mvp.calendar.decorators;

import android.graphics.Color;
import android.text.style.ForegroundColorSpan;

import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.DayViewDecorator;
import com.prolificinteractive.materialcalendarview.DayViewFacade;

/**
 * Created by anonymouslystudio on 2017/7/27.
 */

public class TextDecorator implements DayViewDecorator{
    private String text;
    private CalendarDay date;
    public TextDecorator(String text, CalendarDay date) {
        this.text = text;
        this.date = date;
    }

    @Override
    public boolean shouldDecorate(CalendarDay day) {
        return day.equals(date);
    }

    @Override
    public void decorate(DayViewFacade view) {

        view.addSpan(new ForegroundColorSpan(Color.WHITE));
    }
}
